const state = () => {
  return {
  }
}

const getters = {
  cards (state, getters, rootState, rootGetters) {
    let cards = rootGetters['exercise-select/cards'].filter(n => n.checked)
    return cards
  },
  sentences (state, getters, rootState, rootGetters) {
    let sentences = rootGetters['exercise-select/sentences'].filter(n => n.checked)
    return sentences
  },
}

const actions = {
  handleExerciseSelect ({ commit, state, rootState }) {
    wx.navigateBack()
  },
  handlePublish ({ commit, state, rootState }) {
    wx.navigateTo({
      url: '/pages/homework-publish/main'
    })
  },
}

const mutations = {
}

export default {
  namespaced: true,
  state,
  getters,
  actions,
  mutations
}
